<?
require_once('FuncionesInternacion.php');

if(isset($_POST['nameFormIngresoInternacion']))
{
    IngresarPacienteInternacion();
}

?>
<form name="nameFormIngresoInternacion" id="iFormIngresoInternacion"  method="POST" enctype="multipart/form-data">
<table width="100%" align="center">
	<tr>
        <td align="center">
            <font class="" color="white"  size="3px" id=""> <b> Ingreso</b></font> 
        </td>
        <td align="right">
        <td width="100%" align="center">
             <?if(isset($_GET['Pac'])!=null)
                {?>
            <a href="javascript:window.print();">
                <img title="Imprimir Ficha Ingreso" border="0" src="images/Dispositivos/print.png" id="idImprimirFichaIngreso"  width="30px" height="30px" class='printbutton'/>
            </a>
            <?}?>
        </td>
	</tr>
    <tr>
        <td width="100%" align="center">
             <?if(isset($_GET['Pac'])!=null)
                {?>
            <table width="100%" align="center">             
                <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>
                                <td align="right" width="35%"> 
                                    <font class="" size="2px"  color="white"  id=""> Sector de Internacion</font> 
                                </td>
                                <td width="5%">
                                </td>
        						<td width="60%">
                                    <input type="text" name="nameSectorIngresoInternacion" style="width:200px" maxlength="15"  />
                                </td>                                            
                            </tr>
                        </table>
                    </td>                                       						
				</tr>
		        <tr>
                     <td width="100%" align="center">
                        <table width="100%">
                            <tr>
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  >
                                        Fecha Ingreso
                                    </font>
                                </td>
        			            <td width="5%">
                                </td>
                                <td width="60%">
                                
                                    <input type="text" name="nameFechaIngresoInternacion" style="width:200px" maxlength="15" value="<?echo date("d/m/Y, g:ia");?>"/>
                                </td>
                            </tr>
                       </table>
                     </td>
		        </tr>
		        <tr>
                     <td width="100%" align="center">
                        <table width="100%">
                            <tr>                            
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        Apellido y Nombre
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="text" name="nameApellidoNombreInternacion" disabled="" style="width:200px" maxlength="25"
                                    <? echo "value='".$_SESSION['ApellidoPaciente'].", ".$_SESSION['NombrePaciente']."'";?>/>
                                </td>
                            </tr>
                       </table>
                     </td>
		        </tr>
		         <tr>
                     <td width="100%" align="center">
                        <table width="100%">
                            <tr>    
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        N&uacute;mero Documento
                                    </font>
                                </td>
        			            <td width="5%">
                                </td>
                                <td width="60%">
                                    <input type="text" name="nameDocumentoInternacion" disabled="" style="width:200px" maxlength="11"
                                    <? echo 'value="'.$_SESSION['NumDocPaciente'].'"';?> />                                                 
                                </td>
                            </tr>
                       </table>
                     </td>
		        </tr>
                <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>  
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        Genero (M - F)   
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="text" name="nameSexoInternacion" disabled="" style="width:200px" maxlength="30" 
                                    <? echo 'value="'.$_SESSION['SexoPaciente'].'"';?> />
                                </td>
                            </tr>
                       </table>
                     </td>    
		        </tr>
                <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>  
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        Persona a notificar 
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="text" name="namePersonaNotificaInternacion" 
                                    style="width:200px" maxlength="40" />
                                </td>
                            </tr>
                       </table>
                     </td>    
		        </tr>		
		         <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>                               
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                     Motivo de Internaci&oacute;n
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <textarea name="nameMotivoInternacion" style="width:200px"  rows="4"></textarea> 
                                </td>
                            </tr>
                       </table>
                     </td>  
		        </tr>	
                <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>                               
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white" >
                                     Estudio Complementario
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="file" name="nameEstudioComplementarioInternacion" style="width:200px; font-size: 10px;" /> 
                                </td>
                            </tr>
                       </table>
                     </td>  
		        </tr>   
		         <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr>                               
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                     Autorizaci&oacute;n
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="file" name="nameAutorizacionInternacion" style="width:200px; font-size: 10px;" /> 
                                </td>
                            </tr>
                       </table>
                     </td>  
		        </tr>                          
		        <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr> 
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        M&eacute;dico
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="text" name="nameMedicoInternacion" disabled="" value="<? echo $_SESSION['ApellidoLogin'].", ".$_SESSION['NombreLogin'];?>" style="width:200px" maxlength="30" />
                               </td>
                            </tr>
                       </table>
                     </td>      
		        </tr>        
		        <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr> 
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        Matr&iacute;cula 
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                    <input type="text" name="nameMatriculaInternacion" disabled="" value="<? echo $_SESSION['Matricula'];?>" style="width:200px" maxlength="30" />
                               </td>
                            </tr>
                       </table>
                     </td>      
		        </tr>   
		        <tr>
                    <td width="100%" align="center">
                        <table width="100%">
                            <tr> 
        			            <td align="right" width="35%">
                                    <font class="" size="2px"  color="white"  id="">
                                        Firma Digital
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
        			            <td width="60%">
                                   
                               </td>
                            </tr>
                       </table>
                     </td>      
		        </tr>   
                <tr>
                    <td width="100%">
                        <table width="100%">
                            <tr>
                                <td align="right" width="35%" >
                                    <font class="" size="2px"  color="white"  id="">
                                        N&uacute;mero de cama:
                                    </font>
                                </td>
                                <td width="5%">
                                </td>
                                <td width="10%">
                                    <div id="idNumCama"  >
                                        <input type="text" disabled=""  name="nameNumCama" value="" style="background-color: white; width: 50px;" />
                                    </div>
                                </td>
                                <td align="left" width="25%" style=" background-color:white; border-style: solid;border-color: purple;border-radius:5px;">
                                    <a onclick="abrirdivCamaInternacion();" href="#">
                                        <input title="Buscar cama disponible" type="button"  style=" width: 20px; background-color: white;border-radius:5px; "/> 
                                        <font color="#E653DA"  size="2px" style=" font-weight: bold; text-decoration: none;"> Buscar Cama</font>
                                    </a>
                                </td>  
                                <td width="15%">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td width="100%" align="center">
                        <table width="80%" align="center" style="margin-right: -5px;">
                            <tr>
                                <td width="100%" align="center">
                                <div  align="center" id="divCamasInternacion" style="display: none;">
                                    <table align="center"  style=" background-color: white; border-style: solid;border-color: white;border-radius:5px;" >
                                        <tr>
                                            <td align="center">                                                
                                                <?  require_once('Grid/gridcamainternacion.php');?> 
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="demo" align="center">
                                                <input type="button" id="getCama1" style="width:120px;  font-size:10px;" name="namegetCama1" value="Seleccionar" />      
                  				 		     </td>
                                        </tr>
                                    </table>
                                </div>
                                </td>
                            </tr>
                        </table>
                    </td>                    
                </tr>                
		        <tr>
			        <td height="5px" >
			        </td>
		        </tr>     
            </table>
            <?}else{
                echo "No hay paciente en curso";
            }?>
        </td>
    </tr>
    <tr>
        <td width="100%" align="center">
           <?if(isset($_GET['Pac'])!=null)
                {?>
            <table width="40%" align="center">
                <tr>
                    <td>
                    	<div class="demo">
                    	   <input  style=" width:100px; font-size:10px;" type="submit" name="nameSubmitIngresoInternacion" value="Ingreso" />
                    	</div>
                    </td>
                    <td align="right">
                    	<div class="demo">
                   		   <input  style="width:100px; font-size:10px;" type="button" onclick="cerrarCancelarIngreso();" name="nameCancelarIngreso" value="Cancelar"/>
                    	</div>
                    </td>
                </tr>
            </table>
            <?}?>
        </td>
    </tr>   
</table>
</form>